#! /bin/sh
# Model 3: Simple 4 media model


# model number
model=3


# data directory (optional, if not set data will go into current directory
datadir=../datadir/

psfile=${datadir}model${model}.eps
datafile=${datadir}model${model}.data

##### Build 4 media model
####     model shown in Figure 4 of the GBmod-paper
#####

trimodel xmin=0 zmin=0 xmax=2.0 zmax=1.0 \
1       xedge=0.0,2.0 \
	zedge=0.0,0.0 \
	sedge=1.0,1.0 \
2       xedge=0.0,1.00,2.0 \
	zedge=0.2,0.25,0.2 \
	sedge=0.8,0.80,0.8 \
3 	xedge=0.00,0.50,1.00,1.50,2.00 \
	zedge=0.50,0.45,0.40,0.48,0.50 \
	sedge=0.75,0.75,0.75,0.75,0.75 \
4 	xedge=0.00,0.50,1.00,1.50,2.00 \
	zedge=0.90,0.80,0.75,0.70,0.80 \
	sedge=0.50,0.50,0.50,0.65,0.70 \
5 	xedge=0.00,0.50,1.00,1.50,2.00 \
	zedge=1.00,1.00,1.00,1.00,1.00 \
	sedge=0.00,0.00,0.00,0.00,0.00 \
kedge=1,2,3,4,5 \
v1	sfill=0.01,0.90,0,0,0.45,0,0.0 \
	>$datafile

# make PostScript plot of data
spsplot <$datafile gtri=-1 \
	label1="Depth (km)" label2="Distance (km)" \
	hbox=3 gmin=0.15 title="Simple 4 media model" \
	>$psfile

##### Put the PostScript on screen 
##### the user may set the shell environment variable 
##### PSPREVIEWER to have PostScript output viewed on the screen

if test "$PSPREVIEWER" = ""
then
	echo "Environment variable PSPREVIEWER is not set."
else
	$PSPREVIEWER <$psfile &
fi

exit 0

